#include <iostream>
#include <vector>
#include <string>

using namespace std;

int centerIsEle(string s, int i){
    int j = 1;
    while(i-j >= 0 && i+j < s.size()){
        if(s[i+j] != s[i-j]){
            break;
        }
        j++;
    }
    return j;
}

int centerIsLine(string s, int i){
    int j = i-1, n = 0;
    while(j-n >= 0 && i+n < s.size()){
        if(s[i+n] != s[j-n]){
            break;
        }
        n++;
    }
    return n;
}

int countSubstrings(string s) {
    int n = 0;
    for(int i = 0; i < s.size(); i++){
        string t;
        n += centerIsEle(s, i);
        n += centerIsLine(s, i);
    }
    return n;
}

int main(){
    string s = "Hello";
    cout << countSubstrings(s) << endl;
    return 0;
}
